package top.college.jjb;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import top.college.model.ProfessorVO;
import top.college.model.StudentVO;
import javax.swing.SwingConstants;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;

// 메인창
public class mainpanel extends JPanel {
	private JTable table;
	private JTable table_1;
	
	public mainpanel() {	
	setLayout(new BorderLayout(0, 0));
	StudentVO sv = new  StudentVO();
	JTextField jt = new JTextField();
	sv.setStd_no(jt.getText());
	sv.setStd_name(jt.getText());
	sv.setStd_tel(jt.getText());
	sv.setStd_addr(jt.getText());
	
	sv.setDept_no(jt.getText());
	ProfessorVO pf = new ProfessorVO();
	
	//과목 
	pf.setProf_name(jt.getText());
	sv.setTot_point(jt.getText());
	//과목  과목구분 
	pf.setProf_name(jt.getText());
	sv.setTot_point(jt.getText());
	sv.getTot_point();
	up();
	bottom();	
		
	}
			
private void up(){
	StudentVO s = new StudentVO();
	JPanel myinfo = new JPanel();
	add(myinfo, BorderLayout.NORTH);
	myinfo.setLayout(new BorderLayout(0, 0));
	
	JPanel panel = new JPanel();
	panel.setPreferredSize(new Dimension(20, 20));
	myinfo.add(panel, BorderLayout.NORTH);
	panel.setLayout(new BorderLayout(0, 0));
	
	JLabel lblNewLabel = new JLabel("개인 정보");
	lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
	panel.add(lblNewLabel, BorderLayout.CENTER);
	
	JPanel infomation = new JPanel();
	infomation.setPreferredSize(new Dimension(0, 75));
	myinfo.add(infomation);
	infomation.setLayout(new BorderLayout(0, 0));
	
	JPanel panel_1 = new JPanel();
	panel_1.setPreferredSize(new Dimension(25, 25));
	infomation.add(panel_1, BorderLayout.CENTER);
	panel_1.setLayout(new GridLayout(0, 5, 0, 0));
	
	
	JLabel label_10 = new JLabel("학번");
	label_10.setHorizontalAlignment(SwingConstants.CENTER);
	panel_1.add(label_10);
	
	JLabel label_11 = new JLabel("이름");
	label_11.setHorizontalAlignment(SwingConstants.CENTER);
	panel_1.add(label_11);
	
	JLabel label_12 = new JLabel("전화번호");
	label_12.setHorizontalAlignment(SwingConstants.CENTER);
	panel_1.add(label_12);
	
	JLabel label_13 = new JLabel("주소");
	label_13.setHorizontalAlignment(SwingConstants.CENTER);
	panel_1.add(label_13);
	
	JLabel label_14 = new JLabel("학과번호");
	label_14.setHorizontalAlignment(SwingConstants.CENTER);
	panel_1.add(label_14);
	
	JPanel panel_2 = new JPanel();
	panel_2.setPreferredSize(new Dimension(25, 50));
	infomation.add(panel_2, BorderLayout.SOUTH);
	panel_2.setLayout(new GridLayout(0, 5, 0, 0));
	
	JLabel lblNewLabel_1 = new JLabel("학번 출력");
	lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
	lblNewLabel_1.setHorizontalTextPosition(SwingConstants.CENTER);
	panel_2.add(lblNewLabel_1);
	
	JLabel label = new JLabel();
	label.setHorizontalTextPosition(SwingConstants.CENTER);
	label.setText("이름출력");
	label.setHorizontalAlignment(SwingConstants.CENTER);
	panel_2.add(label);
	
	JLabel label_1 = new JLabel();
	label_1.setHorizontalTextPosition(SwingConstants.CENTER);
	label_1.setText("전화번호 출력");
	label_1.setHorizontalAlignment(SwingConstants.CENTER);
	panel_2.add(label_1);
	
	JLabel label_2 = new JLabel();
	label_2.setHorizontalTextPosition(SwingConstants.CENTER);
	label_2.setText("주소출력");
	label_2.setHorizontalAlignment(SwingConstants.CENTER);
	panel_2.add(label_2);
	
	JLabel label_3 = new JLabel();
	label_3.setHorizontalTextPosition(SwingConstants.CENTER);
	label_3.setText("학과번호 출력");
	label_3.setHorizontalAlignment(SwingConstants.CENTER);
	panel_2.add(label_3);
	
	
	
	
}
private void bottom(){
	ProfessorVO p = new ProfessorVO();
	StudentVO s = new StudentVO();
	
	JPanel bottom = new JPanel();
	add(bottom, BorderLayout.CENTER);
	bottom.setLayout(new GridLayout(0, 2, 0, 0));
	JPanel b_leftPanel = new JPanel();
	b_leftPanel.setLayout( new BorderLayout(0, 0));
		bottom.add(b_leftPanel);
		
		JPanel sungjuk = new JPanel();
		b_leftPanel.add(sungjuk, BorderLayout.NORTH);
		
		JLabel sung = new JLabel("성적조회");
		sungjuk.add(sung);
		
		JPanel panel_1 = new JPanel();
		b_leftPanel.add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		JPanel page = new JPanel();
		panel_1.add(page, BorderLayout.CENTER);
		page.setLayout(new BorderLayout(0, 0));
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setPreferredSize(new Dimension(0, 0));
		page.add(scrollPane, BorderLayout.CENTER);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null,null,null,},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
			},
			new String[] {
				"과목명", "담당교수", "총점"
			}
		));
		

	
	JPanel rightPanel = new JPanel();
	rightPanel.setLayout( new BorderLayout( 0, 0) );

	JPanel register = new JPanel();
	rightPanel.add(register, BorderLayout.NORTH);
	
	JLabel registerlab = new JLabel("수강내역");
	register.add(registerlab);
	
	
	
	JPanel panel_6 = new JPanel();
	
	
	rightPanel.add(panel_6, BorderLayout.CENTER);
	panel_6.setLayout(new BorderLayout(0, 0));
	
	JPanel registerpage = new JPanel();
	panel_6.add(registerpage, BorderLayout.CENTER);
	registerpage.setLayout(new BorderLayout(0, 0));
	
	JScrollPane scrollPane_1 = new JScrollPane();
	scrollPane_1.setPreferredSize(new Dimension(0, 0));
	registerpage.add(scrollPane_1);
	
	table_1 = new JTable();
	table_1.setModel(new DefaultTableModel(
		new Object[][] {
			{null, null, null, null},
			{null, null, null, null},
			{null, null, null, null},
			{null, null, null, null},
			{null, null, null, null},
			{null, null, null, null},
			{null, null, null, null},
		},
		new String[] {
			"과목명", "담당교수", "과목구분", "학점"
		}
	));
	scrollPane_1.setViewportView(table_1);
	bottom.add(rightPanel);
	
}
}

